{template 'common/header'}
{if IMS_VERSION<1}
    <link href="{MODULE_URL}/template/static/css/wq1.0.css" rel="stylesheet">
{/if}

<script src="{MODULE_URL}/template/static/js/mzp-packed-me.js"></script>

<div class="we7-page-title">分成管理</div>
<ul class="we7-page-tab">
    <li{if $_GPC['do'] == 'manage' || $_GPC['do'] == '' } class="active"{/if}><a href="{php echo $this->createWebUrl('manage');}">分成管理</a></li>
</ul>
<div class="we7-padding-bottom clearfix">
    <div class="pull-right">
        <a href="{php echo url('site/entry/all_user',array('m'=>'tyzm_diamondvote'));}" class="btn btn-primary  we7-margin-left">查看所有用户</a>
        <a href="{php echo url('site/entry/add_leader',array('m'=>'tyzm_diamondvote'));}" class="btn btn-primary  we7-margin-left">+设置管理员</a>
    </div>
</div>
<table class="table we7-table table-hover site-list">
    <thead>
    <tr>
        <th colspan="2" class="text-left">管理员ID</th>
        <th colspan="2" class="text-left">管理员昵称</th>
        <th colspan="2" class="text-left">资金</th>
        <th class="text-left" width="200px">操作</th>
    </tr>
    </thead>
    {loop $list $row}
        <tr>
            <th colspan="2" class="text-left">{$row['id']}</th>
            <th colspan="2" class="text-left">{$row['nickname']}</th>
            <th colspan="2" class="text-left">{$row['prize']}元</th>
            <th class="text-left" width="200px">
                <a href="{php echo $this->createWebUrl('leader_member',array('id'=>$row['id']))}">查看所属成员</a>
            </th>
        </tr>
    {/loop}
</table>
</div>

<script>
    $(function(){

        $(".check_all").click(function(){
            var checked = $(this).get(0).checked;
            $("input[type=checkbox]").attr("checked", checked);
        });
        $("input[name=deleteall]").click(function(){

            var check = $("input:checked");
            if (check.length < 1){
                err('请选择要删除的记录!');
                return false;
            }
            if (confirm("确认要删除选择的记录?")){
                var id = new Array();
                check.each(function(i){
                    id[i] = $(this).val();
                });
                $.post('{php echo create_url('site/module', array('do' => 'deleteAll', 'name' => 'tyzm_diamondvote'))}', {idArr:id}, function(data){
                    if (data.errno == 0)
                    {
                        location.reload();
                    } else {
                        alert(data.error);
                    }


                }, 'json');
            }

        });




    });
</script>
<script type="text/javascript">
    function drop_confirm(msg, url){
        if (confirm(msg)){
            window.location = url;
        }
    }
    $('.js-clip').each(function(){
        util.clip(this, $(this).attr('data-url'));
    });

</script>

{template 'common/footer'}